<?php

$data = file_get_contents('./data.txt');

var_dump($data);

var_dump(json_decode($data,true));exit;

$arr =  [
	['name'=>'小明','score'=>'80'],
	['name'=>'小红','score'=>'70'],
	['name'=>'小花','score'=>'95'],
	['name'=>'小木','score'=>'80'],
	['name'=>'小森','score'=>'60'],
	['name'=>'小磊','score'=>'70']
];

$str = json_encode($arr);
// xml json格式 
file_put_contents('./data.txt', $str);
